package com.mario.repository;

import java.util.List;

import org.hibernate.HibernateException;

import com.mario.domain.MySerializable;

public interface Dao<T extends MySerializable> {

	/* INSERTS AND UPDATES */
	public long persist(T t) throws HibernateException;
	public void update(T t) throws HibernateException;
	
	/* SELECTS */
	public T load(Long id);	
	public List<T> getAll();
	
	/* DELETES */
	public void deleteById(Long id);
	public void delete(T t);
	public int deleteAll();
	
	/* COUNTS AND FINDS */
	public int count();
	public List<T> findByExample(T exampleObject);
}
